/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.math;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public class Rectangle extends Form2D {
    
    private float width;
    private float height;

    public Rectangle() {
        this("Rectangle", 0f, 0f, 0f, 0f);
    }
    public Rectangle(String name) {
        this(name, 0f, 0f, 0f, 0f);
    }
    public Rectangle(String name, float x, float y, float width, float height) {
        super(name, x, y);
        this.width = width;
        this.height = height;
    }
    
    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    @Override
    public float getArea() {
        return (width * height);
    }
    
    @Override
    public String toString() {
        return getName()+"{" + "x=" + getX() + ", y=" + getY() + ", width=" + width + ", height=" + height + '}';
    }   
    
}
